package com.toonyoo.eurekaproducer;

import com.toonyoo.eurekaproducer.util.Retry;
import com.toonyoo.eurekaproducer.util.RetryListener;
import com.toonyoo.eurekaproducer.util.RetryManage;

import java.util.Calendar;
import java.util.Random;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class Main {

    public static int i = 0;

    public static void main(String[] args) {
//        Random random = new Random(System.currentTimeMillis());
//
//        new RetryManage(new Retry() {
//            @Override
//            public boolean doTry() {
//                int i = random.nextInt(10);
//                System.out.println(i);
//                if(i<3){
//                    throw new RuntimeException("随机数小于3");
//                }
//                return i > 8;
//            }
//        }, new RetryListener() {
//            @Override
//            public void success() {
//                System.out.println("调用成功");
//            }
//
//            @Override
//            public void fail() {
//                System.out.println("调用失败");
//            }
//
//            @Override
//            public void exception(Exception e) {
//                System.out.println("调用异常 ==== " + e.getMessage());
//            }
//        }, 10).call();

        System.out.println(Calendar.getInstance().get(Calendar.HOUR_OF_DAY));
    }
}
